﻿using Glorysoft.EAP.EAPwell.web.entity;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Glorysoft.EAP.Core
{
    public class LotInfo
    {
        /// <summary>
        /// 设备ID
        /// </summary>
        public string eqptID { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        public string userName { get; set; }
        /// <summary>
        /// batchId
        /// </summary>
        public string batchId { get; set; }

        public int trackOutRetryCount { get; set; }
        public string lotState { get; set; }

        /// <summary>
        /// 批次Id
        /// </summary>
        public string lotId { get; set; }

       /// <summary>
       /// 批次类型
       /// </summary>
        public string lotType { get; set; }

        //重测标记，如果重测则不卡控重复数据
        public bool retestFlag { get; set; }

        /// <summary>
        /// 产品号
        /// </summary>
        public string productId { get; set; }

        /// <summary>
        /// 工步
        /// </summary>
        public string operationId { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public string qty1 { get; set; }

        /// <summary>
        /// recipe
        /// </summary>
        public string recipeId { get; set; }

        /// <summary>
        /// ppid
        /// </summary>
        public string ppid { get; set; }

        /// <summary>
        /// recipeLogicalRrn
        /// </summary>
        public string recipeLogicalRrn { get; set; }

        /// <summary>
        /// reticleGroupId
        /// </summary>
        public string reticleGroupId { get; set; }

        /// <summary>
        /// reticleGroupRrn
        /// </summary>
        public string reticleGroupRrn { get; set; }

        /// <summary>
        /// TesterProgram
        /// </summary>
        public string testerProgram { get; set; }

        /// <summary>
        /// ProberRecipe
        /// </summary>
        public string proberRecipe { get; set; }

        /// <summary>
        /// 房间号
        /// </summary>
        public string facilityId { get; set; }

        /// <summary>
        /// jsonvalue
        /// </summary>
        public string jsonvalue { get; set; }


        public List<unitsInfo> UnitList = new List<unitsInfo>();

        /// <summary>
        /// 用户名
        /// </summary>
        public string customerLotId { get; set; }

        /// <summary>
        /// 是否对针 Y:是 N:否
        /// </summary>
        public string Alignment { get; set; } = "Y";
        /// <summary>
        /// 探卡ID
        /// </summary>
        public string ProberCardId { get; set; }

       /// <summary>
       /// 选片集合
       /// </summary>
        public string LotLists { get; set; }
        public bool yieldFlag { get; set; }
        public bool monitorLotFlag { get; set; }

        public JObject monitorConfig {  get; set; }

        public int goldenCount {  get; set; }
        public List<Wafer> waferList { get; set; }
        public Dictionary<string, string> waferInfoDic = new Dictionary<string, string>();
        /// <summary>
        /// MES所有的slotid
        /// </summary>
        public string MesWaferList { get; set; }
        /// <summary>
        ///MesT7codeList  wafer唯一编号
        /// </summary>
        public string UnitidLists { get; set; }

        /// <summary>
        /// 是否全测
        /// </summary>
        public string IsFullmeasurement { get; set; }
        /// <summary>
        /// 批次状态
        /// </summary>
        public string lotStatus { get; set; }

        /// <summary>
        /// 选片模式
        /// </summary>
        public string TestMode { get; set; }

        /// <summary>
        /// Site 单/多模式
        /// </summary>
        public string TestSiteMode { get; set; }

        /// <summary>
        /// 是否为Run Card
        /// </summary>
        public string rcflag { get; set; }
        /// <summary>
        /// ProcessId   
        /// </summary>
        public string ProcessId { get; set; }
        public string parameterSet { get; set; }
        public DateTime? creatTime { get; set; }

    }
    /// <summary>
    /// Wafer信息
    /// </summary>
    public class unitsInfo
    {

        /// <summary>
        /// wafer code 位置
        /// </summary>
        public string t7code { get; set; }
        /// <summary>
        /// slot 位置
        /// </summary>
        public string position { get; set; }
        /// <summary>
        ///  wafer 状态
        /// </summary>
        public string unitstatus { get; set; }
        /// <summary>
        /// wafer Id
        /// </summary>
        public string unitId { get; set; }

    }

    public class Wafer
    {
        public string waferId { get; set; }
        public string passNo { get; set; }

        public DateTime startTime { get; set; }
        public DateTime finishTime { get; set; }

        public string processFlag { get; set; }

        public string processState { get; set; }

        public string postion { get; set; }

        public string yield { get; set; }
        public Boolean yieldFlag { get; set; }

        public string p50Median { get; set; }

        public bool p50MedianFlag { get; set; }

        public Dictionary<string, ArrayList> valueMap { get;set; }
        public List<Summary> Summaries { get; set; }

    }

    public class TrackOutPara
    {
        public string facilityId { get; set; }
        public string userName { get; set; }
        public string eqpid { get; set; }
        public string lotID { get; set; }
        public string jsonvalue { get; set; }
        public DateTime Time { get; set; }
    }
}
